3.5.61 \(\int \cos (c+d x) (a+b \sec (c+d x))^2 \, dx\) [461]

Optimal. Leaf size=33 \[ 2 a b x+\frac {b^2 \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a^2 \sin (c+d x)}{d} \]

[Out]

2*a*b*x+b^2*arctanh(sin(d*x+c))/d+a^2*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {3873, 8, 4130, 3855} \begin {gather*} \frac {a^2 \sin (c+d x)}{d}+2 a b x+\frac {b^2 \tanh ^{-1}(\sin (c+d x))}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*(a + b*Sec[c + d*x])^2,x]

[Out]

2*a*b*x + (b^2*ArcTanh[Sin[c + d*x]])/d + (a^2*Sin[c + d*x])/d

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3873

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^2, x_Symbol] :> Dist[2*a*(b/d
), Int[(d*Csc[e + f*x])^(n + 1), x], x] + Int[(d*Csc[e + f*x])^n*(a^2 + b^2*Csc[e + f*x]^2), x] /; FreeQ[{a, b
, d, e, f, n}, x]

Rule 4130

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[A*Cot[e
+ f*x]*((b*Csc[e + f*x])^m/(f*m)), x] + Dist[(C*m + A*(m + 1))/(b^2*m), Int[(b*Csc[e + f*x])^(m + 2), x], x] /
; FreeQ[{b, e, f, A, C}, x] && NeQ[C*m + A*(m + 1), 0] && LeQ[m, -1]

Rubi steps

\begin {align*} \int \cos (c+d x) (a+b \sec (c+d x))^2 \, dx &=(2 a b) \int 1 \, dx+\int \cos (c+d x) \left (a^2+b^2 \sec ^2(c+d x)\right ) \, dx\\ &=2 a b x+\frac {a^2 \sin (c+d x)}{d}+b^2 \int \sec (c+d x) \, dx\\ &=2 a b x+\frac {b^2 \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a^2 \sin (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 46, normalized size = 1.39 \begin {gather*} 2 a b x+\frac {b^2 \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a^2 \cos (d x) \sin (c)}{d}+\frac {a^2 \cos (c) \sin (d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*(a + b*Sec[c + d*x])^2,x]

[Out]

2*a*b*x + (b^2*ArcTanh[Sin[c + d*x]])/d + (a^2*Cos[d*x]*Sin[c])/d + (a^2*Cos[c]*Sin[d*x])/d

________________________________________________________________________________________

Maple [A]
time = 0.07, size = 43, normalized size = 1.30

method result size
derivativedivides \(\frac {a^{2} \sin \left (d x +c \right )+2 b a \left (d x +c \right )+b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(43\)
default \(\frac {a^{2} \sin \left (d x +c \right )+2 b a \left (d x +c \right )+b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(43\)
risch \(2 a b x -\frac {i a^{2} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2}}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2}}{d}\) \(84\)
norman \(\frac {-2 a b x -\frac {2 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 a^{2} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+2 a b x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {b^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {b^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) \(130\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(a+b*sec(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^2*sin(d*x+c)+2*b*a*(d*x+c)+b^2*ln(sec(d*x+c)+tan(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 51, normalized size = 1.55 \begin {gather*} \frac {4 \, {\left (d x + c\right )} a b + b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, a^{2} \sin \left (d x + c\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))^2,x, algorithm="maxima")

[Out]

1/2*(4*(d*x + c)*a*b + b^2*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 2*a^2*sin(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 2.29, size = 52, normalized size = 1.58 \begin {gather*} \frac {4 \, a b d x + b^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - b^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, a^{2} \sin \left (d x + c\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))^2,x, algorithm="fricas")

[Out]

1/2*(4*a*b*d*x + b^2*log(sin(d*x + c) + 1) - b^2*log(-sin(d*x + c) + 1) + 2*a^2*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \cos {\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))**2,x)

[Out]

Integral((a + b*sec(c + d*x))**2*cos(c + d*x), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 78 vs. \(2 (33) = 66\).
time = 0.46, size = 78, normalized size = 2.36 \begin {gather*} \frac {2 \, {\left (d x + c\right )} a b + b^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - b^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))^2,x, algorithm="giac")

[Out]

(2*(d*x + c)*a*b + b^2*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - b^2*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 2*a^2*tan
(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1))/d

________________________________________________________________________________________

Mupad [B]
time = 0.85, size = 73, normalized size = 2.21 \begin {gather*} \frac {a^2\,\sin \left (c+d\,x\right )}{d}+\frac {2\,b^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)*(a + b/cos(c + d*x))^2,x)

[Out]

(a^2*sin(c + d*x))/d + (2*b^2*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (4*a*b*atan(sin(c/2 + (d*x)/2)
/cos(c/2 + (d*x)/2)))/d

________________________________________________________________________________________